package com.tuanzi.loan.web.bean.family;

import com.tuanzi.loan.core.aspect.Debug;
import com.tuanzi.loan.web.configuration.JSFListingBean;

import com.tuanzi.loan.vo.request.family.IcpWebIpVisitRecordSearchRequest;
import com.tuanzi.loan.vo.response.family.IcpWebIpVisitRecordSearchResponse;
import com.tuanzi.loan.web.lazy.family.IcpWebIpVisitRecordDataModel;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.stereotype.Component;
import javax.annotation.PostConstruct;
import javax.faces.bean.ViewScoped;

/**
 * ICP备案网站IP访问记录
 * @author JinRuiyang 2017/12/14 10:07:19
 */
@Debug
@Data
@Component
@ViewScoped
@EqualsAndHashCode(callSuper = true)
public class IcpWebIpVisitRecordBean extends JSFListingBean<IcpWebIpVisitRecordSearchRequest, IcpWebIpVisitRecordSearchResponse> {
    @PostConstruct
    private void init() {
        initLazyDataModel();
    }

    public void onReset() {
        initLazyDataModel();
    }

    public void onRefresh(){
        lazyDataModel = new IcpWebIpVisitRecordDataModel($);
        addSuccessfullyMessage();
    }

    private void initLazyDataModel() {
        $ = new IcpWebIpVisitRecordSearchRequest();
        lazyDataModel = new IcpWebIpVisitRecordDataModel($);
    }
}